package com.jt.www.model.vo.endorse;

import com.jt.www.enums.endorse.*;
import com.jt.www.model.entity.endorse.EndorseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang.StringUtils;

/**
 * excel清单解析出的对象
 */

public class EndorseParseVo {

    @ApiModelProperty(value = "学生/教师 姓名")
    private String name;

    @ApiModelProperty(value = "证件类型")
    private String certificateType;

    @ApiModelProperty(value = "证件号")
    private String cardNo;

    @ApiModelProperty(value = "年级：一年级，二年级，三年级，四年级，五年级，六年级，七年级")
    private String grade;

    @ApiModelProperty(value = "性别：男，女")
    private String sex;

    @ApiModelProperty(value = "专业")
    private String professional;

    @ApiModelProperty(value = "学生/教师")
    private String studentTeacher;

    @ApiModelProperty(value = "附加被保险人：是，否")
    private String AdditionalInsured;

    @ApiModelProperty(value = "附加实习无过失：是，否")
    private String AdditionalInternship;

    @ApiModelProperty(value = "班级")
    private String clz;

    @ApiModelProperty(value = "学籍号")
    private String schoolRoll;

    @ApiModelProperty(value = "附加校方无过失：是，否")
    private String additionalSchool;

    @ApiModelProperty(value = "附加校外无过失：1-是，2-否")
    private String additionalOutSchool;

    @ApiModelProperty(value = "附加传染病：1-是，2-否")
    private String infectiousDiseases;

    @ApiModelProperty(value = "学校名称")
    private String schoolName;

    @ApiModelProperty(value = "年龄")
    private String age;

    @ApiModelProperty(value = "联系电话")
    private String phoneNum;

    @ApiModelProperty(value = "监护人姓名")
    private String guardianName;

    @ApiModelProperty(value = "监护人电话")
    private String guardianPhoneNum;

    @ApiModelProperty(value = "出生日期")
    private String birthDate;

    @ApiModelProperty(value = "备注")
    private String note;

    public static EndorseEntity convertEntity(EndorseParseVo parseVo) {
        EndorseEntity endorse = new EndorseEntity();
        endorse.setName(StringUtils.isBlank(parseVo.getName()) ? "" : parseVo.getName().trim());
        endorse.setCertificatetype(CertificateTypeEnum.getCodeByMsg(parseVo.getCertificateType()));
        endorse.setCardno(StringUtils.isBlank(parseVo.getCardNo()) ? "" : parseVo.getCardNo().trim());
        endorse.setGrade(GradeEnum.getCodeByMsg(parseVo.getGrade()));
        endorse.setSex(SexEnum.getCodeByMsg(parseVo.getSex()));
        endorse.setProfessional(parseVo.getProfessional());
        endorse.setStudentteacher(StudentTeacherEnum.getCodeByMsg(parseVo.getStudentTeacher()));
        endorse.setAdditionalinsured(AdditionalInsuredEnum.getCodeByMsg(parseVo.getAdditionalInsured()));
        endorse.setAdditionalinternship(AdditionalInternshipEnum.getCodeByMsg(parseVo.getAdditionalInternship()));
        endorse.setClz(parseVo.getClz());
        endorse.setSchoolroll(parseVo.getSchoolRoll());
        endorse.setAdditionalschool(AdditionalSchoolEnum.getCodeByMsg(parseVo.getAdditionalSchool()));
        endorse.setSchoolName(parseVo.getSchoolName());

        endorse.setAdditionaloutschool(AdditionalOutSchoolEnum.getCodeByMsg(parseVo.getAdditionalOutSchool()));
        endorse.setInfectiousdiseases(InfectiousDiseasesEnum.getCodeByMsg(parseVo.getInfectiousDiseases()));

        endorse.setAge(parseVo.getAge());
        endorse.setPhonenum(StringUtils.isBlank(parseVo.getPhoneNum()) ? "" : parseVo.getPhoneNum().trim());
        endorse.setGuardianname(parseVo.getGuardianName());
        endorse.setGuardianphonenum(parseVo.getGuardianPhoneNum());
        endorse.setBirthdate(parseVo.getBirthDate());
        endorse.setNote(parseVo.getNote());

        return endorse;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCertificateType() {
        return certificateType;
    }

    public void setCertificateType(String certificateType) {
        this.certificateType = certificateType;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getProfessional() {
        return professional;
    }

    public void setProfessional(String professional) {
        this.professional = professional;
    }

    public String getStudentTeacher() {
        return studentTeacher;
    }

    public void setStudentTeacher(String studentTeacher) {
        this.studentTeacher = studentTeacher;
    }

    public String getAdditionalInsured() {
        return AdditionalInsured;
    }

    public void setAdditionalInsured(String additionalInsured) {
        AdditionalInsured = additionalInsured;
    }

    public String getAdditionalInternship() {
        return AdditionalInternship;
    }

    public void setAdditionalInternship(String additionalInternship) {
        AdditionalInternship = additionalInternship;
    }

    public String getClz() {
        return clz;
    }

    public void setClz(String clz) {
        this.clz = clz;
    }

    public String getSchoolRoll() {
        return schoolRoll;
    }

    public void setSchoolRoll(String schoolRoll) {
        this.schoolRoll = schoolRoll;
    }

    public String getAdditionalSchool() {
        return additionalSchool;
    }

    public void setAdditionalSchool(String additionalSchool) {
        this.additionalSchool = additionalSchool;
    }

    public String getAdditionalOutSchool() {
        return additionalOutSchool;
    }

    public void setAdditionalOutSchool(String additionalOutSchool) {
        this.additionalOutSchool = additionalOutSchool;
    }

    public String getInfectiousDiseases() {
        return infectiousDiseases;
    }

    public void setInfectiousDiseases(String infectiousDiseases) {
        this.infectiousDiseases = infectiousDiseases;
    }

    public String getSchoolName() {
        return schoolName;
    }

    public void setSchoolName(String schoolName) {
        this.schoolName = schoolName;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String getGuardianName() {
        return guardianName;
    }

    public void setGuardianName(String guardianName) {
        this.guardianName = guardianName;
    }

    public String getGuardianPhoneNum() {
        return guardianPhoneNum;
    }

    public void setGuardianPhoneNum(String guardianPhoneNum) {
        this.guardianPhoneNum = guardianPhoneNum;
    }

    public String getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(String birthDate) {
        this.birthDate = birthDate;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }
}
